matrix worldViewProj;
matrix world;

float4 light=float4(0.f,0.f,1.f,0.f);


struct vertexIn {
	float4 position : POSITION0;
	float4 normal	: NORMAL0;
	float2 texcoord	: TEXCOORD0;
};

struct vertexOut {
	float4 position : POSITION0;
	float2 texcoord	: TEXCOORD0;
	float4 normal	: TEXCOORD1;
	float4 worldpos	: TEXCOORD2;
	float4 worldnorm: TEXCOORD3;
};

void vertexShader(in vertexIn IN, out vertexOut OUT) {
	OUT.worldpos	=mul(IN.position,world);
	OUT.worldnorm	=mul(IN.normal,world);
	OUT.position	=mul(IN.position,worldViewProj);
	OUT.normal	=mul(IN.normal,worldViewProj);
	OUT.texcoord	=IN.texcoord;
}

float4 pixelShader(in vertexOut IN) : COLOR {
	float cl=max(0,dot(normalize(light),normalize(IN.worldnorm)));
	return float4(0.5, 0.5, 0.5, 1.0) * cl;
}



technique main	{
	pass p0		{
		vertexshader	=compile vs_2_0	vertexShader();
		pixelshader	=compile ps_2_0	pixelShader();
			}
		}